<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <link href="${ctx.resource}/css/bootstrap-datepicker3.min.css" rel="stylesheet">
  <title>金融商资产 - 租房宝金融管理平台</title>
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="web-g-main">

    <%@ include file="/WEB-INF/include/aside.jsp"%>
    <div class="content">
      <header class="header clearfix">
          <h3 class="pull-left">金融商资产</h3>
           <div class="row">
           		<form action="${ctx}/assets-package/" method="get">
           		
		          	<div class="col-md-3 col-md-offset-3">
				         <div class="input-group input-group-sm">
				         	<span class="input-group-addon">租约号</span>
				          	<input type="text" class="form-control" name="contractNo" value = "${contractNo}" placeholder="租约号"/>
				         </div>
		          	</div>
		          	<div class="col-md-2">
			          	<button type="submit" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn"><i class="glyphicon glyphicon-search"></i>查询</button>
		          	</div>
	          	</form>
	          	<div class="col-md-2">
		            <a href="${ctx}/assets-package/create" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" title="添加资产包"><i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加资产包</a>
	          	</div>
          	</div>
       </header>

       <c:if test="${not empty infoMessage}">
            <div class="alert alert-success alert-dismissable alert-fade top-margin-10 text-align-center">
              <button type="button" class="close" data-dismiss="alert">&times;</button>
              <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;
              <fmt:message key="${infoMessage}" />
            </div>
       </c:if>

       <div class="table-area table-responsive">
           <table class="data-list table table-striped table-hover">
              <thead>
                <tr>
                  <th>序号</th>
                  <th>融资支付日期</th>
                  <th>融资本金</th>
                  <th>融资余额</th>
                  <th>应收账款受让总额</th>
                  <th>最后核销日期</th>
                  <th>租约号</th>
                  <th>保理合同号</th>
                  <th>创建时间</th>
                </tr>
              </thead>
              <tbody>
                <c:forEach var="asset" items="${assetsPackageList}" varStatus="status">
                  <tr>
                    <td>${status.index + 1}</td>
                    <td><fmt:formatDate value = "${asset.advaStartDate}" pattern = "yyyy-MM-dd"/></td>
                    <td><fmt:formatNumber value="${asset.otsdAmt}"  type="currency"/></td>
                    <td><fmt:formatNumber value="${asset.otsdAmtAval }" type="currency"/></td>
                    <td><fmt:formatNumber value="${asset.recTransfeeTotalAmt }" type="currency"/></td>
                    <td><fmt:formatDate value="${asset.latestSettleDate}" pattern="yyyy-MM-dd"/></td>
                    <td>${asset.contract.contractNo }</td>
                    <td>${asset.factoringContract.contractNo }</td>
                    <td>${asset.createTime }</td>
                  </tr>
                </c:forEach>
              </tbody>
           </table>
           
          <c:choose>
            <c:when test="${not empty queryString}">
              <jsp:include page="/WEB-INF/include/page.jsp">
                <jsp:param name="url" value="assets-package/" />
                <jsp:param name="queryString" value="${queryString}" />
              </jsp:include>
            </c:when>
            <c:otherwise>
              <jsp:include page="/WEB-INF/include/page.jsp">
              	<jsp:param value="assets-package" name="url" />
              </jsp:include>
            </c:otherwise>
          </c:choose>

       </div>
       <%@ include file="/WEB-INF/include/footer.jsp"%>
       
    </div>

  </div>
 
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/earth-preupload.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
</body>
</html>